import axios from 'axios'
import Vue from 'vue'

const http = axios.create({
    baseURL: 'http://localhost:7002'
})

http.interceptors.response.use(res => {

    return res.data
})

http.interceptors.request.use(req => {
    req.headers.Authorization = localStorage.getItem('token')
    return req
})

Vue.prototype.$http = http


export default http